//package com.jilefojing.config;
//
//import com.google.common.collect.Lists;
//import com.homedo.shiguangyaoji.bean.constant.HttpHeaderConstant;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.ParameterBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.schema.ModelRef;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.Contact;
//import springfox.documentation.service.Parameter;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger.web.UiConfiguration;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
//import java.util.List;
//
//@Configuration
//@EnableSwagger2
//public class SwaggerConfig {
//
//    @Value("${_version}")
//    private String _version;
//    @Value("${x-springfox.documentation.swagger.v2.basePackage:}")
//    private String basePackage;
//    @Value("${x-springfox.documentation.swagger.v2.title:}")
//    private String title;
//    @Value("${x-springfox.documentation.swagger.v2.description:}")
//    private String description;
//    @Value("${x-springfox.documentation.swagger.v2.contact.name:}")
//    private String contactName;
//    @Value("${x-springfox.documentation.swagger.v2.contact.url:}")
//    private String contactUrl;
//    @Value("${x-springfox.documentation.swagger.v2.contact.email:}")
//    private String contactEmail;
//
//    @Bean
//    public Docket createRestApi() {
//        ParameterBuilder tokenParam = new ParameterBuilder();
//        tokenParam.name(HttpHeaderConstant.LG_TOKEN).description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
//
//        List<Parameter> headerParams = Lists.newArrayList(tokenParam.build());
//
//
//        return new Docket(DocumentationType.SWAGGER_2)
//                .apiInfo(apiInfo())
//                .select()
//                .apis(RequestHandlerSelectors.basePackage(basePackage))
//                .paths(PathSelectors.any())
//                .build().globalOperationParameters(headerParams);
//    }
//
//    private ApiInfo apiInfo() {
//        return new ApiInfoBuilder().contact(new Contact(contactName, contactUrl, contactEmail))
//                .title(title)
//                .description(description)
//                .version(_version)
//                .build();
//    }
//
//    @Bean
//    public UiConfiguration uiConfig() {
//        return new UiConfiguration(null, "list", "alpha", "schema",
//                UiConfiguration.Constants.DEFAULT_SUBMIT_METHODS, false, true, 60000L);
//    }
//
//}
